package com.forekonw.demo4;

import java.util.Scanner;

/**
 *字符串相等要用equals
 */
public class TestMethod3 {
    public static void log(String zhanghao,String mima){

        String i = "jim";
        String j = "123456";
        if (zhanghao.equals(i)&&mima.equals(j)){
            System.out.println("登陆成功");
        }else {
            System.out.println("登陆失败");
        }
    }
    public static void main(String[] args) {
        System.out.println("请输入账号");
        Scanner input = new Scanner(System.in);
        String zhanghao = input.next();
        System.out.println("请输入密码");
        String mima = input.next();
        TestMethod3.log(zhanghao,mima);
    }
}
